

<?php if($mode == "VIDEO"){?>

<div class="module clearfix"></div>
<div>

	<div class="panel-body">
		<?php
		if($this->session->flashdata('message'))
		{
			$msg = $this->session->flashdata('message');
			echo  $this->session->flashdata('message');
		}
		?>
		<div class="col-xs-12 clearfix">
<?php if($post_id && $mem_id && $facilities){?>

			<form class="form-horizontal" method="POST"
				action="<?= base_url();?>member/business/upload_video">
				<input type="hidden"
					name="<?php echo $this->security->get_csrf_token_name(); ?>"
					value="<?php echo $this->security->get_csrf_hash();?>" />

				<div class="form-group">
					<div class="col-sm-12">

						<input type="text" class="form-control" name="video" id="video">
					</div>

				</div>
				<div class="form-group">
					<div class="col-sm-7 col-sm-9">
						<input type="hidden" name="post_id" id="post_id"
							value="<?= $post_id?>">
						<button type="submit" name="upload" class="btn btn-info">Save &
							Continue</button>
						<?php if(!$videos){?>
						<a href="<?= base_url();?>member/dashboard"
							class="btn btn-warning">Skip</a>
						<?php }?>
						<?php if($videos){?>
						<a href="<?= base_url();?>member/dashboard"
							class="btn btn-success">Back to List</a>
						<?php }?>
					</div>

				</div>
			</form>
<?php }else{?>

<div class="alert alert-danger">Oops! You are not allowed to upload video....</div>
<a href="<?= base_url();?>member/dashboard"
							class="btn btn-warning">Skip</a>
<?php }?>

		</div>
		<div class="col-xs-12 clearfix">
			<hr>
			<div class="pin">
				<?php if($videos){?>
				<div class="col2">
					<div class="list">

						<?php foreach ($videos as $videos):?>
						<div class="item">
											
											 <a id="mediaVideo" href="#" data-toggle="modal"  data-target="#videoModal" data-theVideo="//www.youtube.com/embed/<?= $videos->value;?>">
					 <img
								class="img-responsive"
								src="<?=base_url()?>assets/img/data/video.png"
								contenteditable="false">
					 </a>
																				</div>
						
						
					
				
				<div class="modal fade" id="videoModal" tabindex="-1" role="dialog" aria-labelledby="videoModal" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
    <div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
						Business Video
					</div>
      <div class="modal-body">
        
        <div>
          <iframe width="100%" height="350" src=""></iframe>
        </div>
      </div>
    </div>
  </div>
</div>


   
						<?php endforeach;?>
						<?php }else?>


					</div>
				</div>
			</div>

		</div>
	</div>
</div>


<?php }?>
<?php if($mode == "IMG"){?>



<div class="fieldset " id="fieldgroup_ypage_gallery">
				
									<h3 class="title">Gallery</h3>
									<?php if($total == $fac_limit){?>	
				<span class="text text-danger pull-right">You are allowed to only <?= $fac_limit;?> photos on you business </span>
				<?php }?>
				<div class="fieldset-wrapper content">
					
					
																							

	<?php if($post_id && $mem_id && $facilities){?>
<form enctype="multipart/form-data" action="<?= base_url();?>member/business/uploader" method="POST">
<input type="hidden"
					name="<?php echo $this->security->get_csrf_token_name(); ?>"
					value="<?php echo $this->security->get_csrf_hash();?>" />
					
					<div class="form-group fieldzone regular" id="gallery_fieldzone">
					
					<div class="form-group">
					
					<div class="col-sm-12">

										
			<div class="upload-gallery-wrap-outer" id="wrap_gallery">
				<div class="upload-gallery-wrap clearfix">
				<p>
					<div class="upload-wrap pull-left">
						<input class="upload-hidden" name="gallery[]" type="file">
					</div>
					<p>
					<div class="col-sm-5">
					
					<input class="form-control upload-title" placeholder="Title" name="gallery_title[]" maxlength="100" type="text">
</div>
											<button type="button" class="js-add-img btn btn-info"><i
						class="fa fa-lg fa-plus "></i> </button>
						<button type="button" class="js-remove-img btn btn-danger"><i
						class="fa fa-lg fa-minus"></i> </button>
									</div>
									</div>
									
<div class="col-sm-5">
				<input value="<?= $fac_limit;?>" id="gallery" type="hidden">
				</div>
			</div>

	
		
					</div>
</div>
<div class="form-group">
					<div class="col-sm-7 col-sm-9">
						<input type="hidden" name="post_id" id="post_id"
							value="<?= $post_id?>">
						<?php if($total == $fac_limit){?>	
						<button type="submit" name="upload" class="btn btn-info" disabled>Save</button>
						
						<?php }?>
						<?php if($total != $fac_limit){?>
						<button type="submit" name="upload" class="btn btn-info">Save</button>
						<?php }?>
						<?php if(!$photos){?>
						<a href="<?= base_url();?>member/business/video/<?= $post_id;?>"
							class="btn btn-warning">Skip</a>
						<?php }?>
						<?php if($photos){?>
						<a href="<?= base_url();?>member/business/video/<?= $post_id;?>"
							class="btn btn-success">Next</a>
						<?php }?>
							</div>
							</div>

</form>

		<?php }else{?>


<div class="alert alert-danger">Oops! You are not allowed to upload photo....</div>
<a href="<?= base_url();?>member/business/video/<?= $post_id;?>"
							class="btn btn-warning">Skip</a>
<?php }?>											

									</div>

							</div>
				<div class="col-xs-12 clearfix">
			<hr>
			<div class="pin">
				<?php if($photos){?>
				<div class="col2">
					<div class="list">

						<?php foreach ($photos as $photos):?>
						<div class="item">

							<img class="img-responsive" 
								src="<?=base_url()?>assets/img/data/photo/<?= $photos->value;?>"
								contenteditable="false">

								<a href="<?= base_url();?>member/business/delete_photo?photo_id=<?= $photos->id;?>&image=<?= $photos->value;?>&post_id=<?= $photos->post_id;?>" class="btn btn-danger btn-xs">
									Remove</a>
						</div>
						<?php endforeach;?>
						<?php }?>

					</div>
				</div>
			</div>

		</div>
			
		
	<script type="text/javascript" src="<?= base_url();?>assets/js/img.js"></script>

	
<?php }?>
<script>

	
//FUNCTION TO GET AND AUTO PLAY YOUTUBE VIDEO FROM DATATAG
function autoPlayYouTubeModal(){
  var trigger = $("body").find('[data-toggle="modal"]');
  trigger.click(function() {
    var theModal = $(this).data( "target" ),
    videoSRC = $(this).attr( "data-theVideo" ), 
    videoSRCauto = videoSRC+"?autoplay=1" ;
    $(theModal+' iframe').attr('src', videoSRCauto);
    $(theModal+' button.close').click(function () {
        $(theModal+' iframe').attr('src', videoSRC);
    });   
  });
}    

$(document).ready(function(){
	  autoPlayYouTubeModal();
	});


</script>

